#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''=================================================
@Project -> File   ：js逆向 -> 自动重启路由
@IDE    ：PyCharm
@Author ：王启俊
@Date   ：2024/3/24 20:44
@Desc   ：
=================================================='''
import time

import requests

def close():
    data = {
        "mode_name": "device_reset",
        "nonedata": "0.6031007466446812",
        "no": "no",
        "$apple_1.jpg$6YB1btVcSYkuBgoMMbfZaabd": ""
    }
    headers = {
        "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"
    }
    resu = requests.post('http://192.168.1.1/aoaform/device_reset.cgi', data=data, headers=headers)
    print(resu.text)
if __name__ == '__main__':
    while True:
        try:
            close()
        except Exception as e:
            print("重启成功")
        time.sleep(60)  # 每3分钟断一次网
